mob/pc

	verb



/*
Verb references

Activate
Bwicki
Cast
Climb
Commands
Drink
Forum
Freehand
Get
Help
Hub
Ip
Me
NPC
Resthealth
Reshmana
RPS
Say
Showcommands
Spell
Spoon
Who

At the bottom is the new player verb.

ALL FAKE VERBS HAVE A _ prefix!

If you want to add a new verb, do so, but remember to add a fake on at the bottom too.

*/
////////////

		Activate()
			set hidden = 1
			var/obj/object/o = inv_equipped["free_hand"]
			if(o)
				o.Use(src)

		bwicki()
			set hidden = 1
			src << link("http://www.bwicki.byond.com/ByondBwicki.dmb?CastleoftheWinds")

		cast(spell as text)
			set hidden = 1
			src << "You attempt to cast a spell... But fail miserably."

		climb()
			set hidden = 1
			if(!TurnController.Action(src)) return 0
			var/turf/T = src.loc
			if(T.climable && T.down)
				src.Teleport(locate(T.destx,T.desty,T.destz))
				src << "\red You climb down a secret staircase."
				admin << "\red [src] has gone down a secret staircase at [src.x], [src.y], [src.z]."
			if(T.climable &! T.down)
				src.Teleport(locate(T.destx,T.desty,T.destz))
				src << "\red You climb up a secret staircase."

		commands()
			set hidden = 1
			scroll_text({"


<p><i><font color = "grey">Here is a list of all available commands. Some are accessable as verbs whilst others can only be typed in. These that are typed in will have a / before there name, this means to use them you should either type in /command or press delete then type the command.</font>

<center><b><u>Social</B></u></center>

<p><b>say</b> - Say is probably the most used command. For this reason we have quite alot of functionality within the command, for one it will stay at the bottom so that you can type and press enter then type some more, people can be muted and html gets removed automatically. The say verb however is a tad different then normal say verbs. Most only talk to people you can see, however Castles say verb is a world communication, it also can be used to talk to people nearby. The only difference is in the first letter you type. If you typed <i>say "Hello"</i> it would say hello to the world, if you typed <i>say "*Hello"</i> then it would say <font color = blue>Hello</font to the people on your screen. This is to keep the verb list uncluttered. </p>

<p><b>/me</b> - /me is the default emote command, it has the same set-up as the say command utilising the <font color = blue>*</font> technique we created. <p>

<p><b>/who</b> - This is the plain old Who's Online command. Lists the players online and there key in conical form. Eg. in lowertext, or readable version.  <p>

<p><b>/forum</b> - /forum brings up the forum, we may make it easier to get there to promote growth ;) <p>

<p><b>/bwicki</b> - This takes you to our bwicki page, there are more details one the actual site about what you can do there. Its worth going to for the sake of it. <p>

<center><b><u>Game-play</B></u></center>

<p><b>/get</b> - /get picks up an object off the floor and puts it in your inventory. You get a little message saying you have picked it up too, ain't we kinda? <p>

<p><b>/inventory</b> - /inventory takes you to the inventory, here you equip and de-equip stuff. Its all fun and games there <p>

<p><b>/rest</b> - /rest lets you choose between restmana and resthealth, easier to type basically <p>

<p><b>/restmana</b> - /restmana makes you rest until your mana has reached the top. <p>

<p><b>/resthealth</b> - /resthealth lets you rest until your health has reached the top <P>

<p><b>/npc</b> - You can talk to most NPC's that are around via /say but this however has drawbacks as you can look weird talking to nobody and so we have included a /npc verb which acts like say but only you and the NPC can hear it, handy if you prefer to keep yourself to yourself. <p>

<p><b>/help</b> - /help brings up the general help-files <p>

<p><b>Hidden commands</b> - There are hidden commands hidden in this game, some are pretty easy to guess whilst others are ones that there may be hints about. You just have to find them, be sure there are no commands that can give you an advantage over someone. That would just be silly. <p>
"},src)

		drink()
			set hidden = 1
			if(!TurnController.Action(src)) return 0
			var/turf/T = src.loc; if(istype(T,/turf/outside/floor/well))
				if(src.Gender == "male")
					src.Gender = "female"
				else
					src.Gender = "male"
				FindSpecialIcon(src)
				var/icon/I = new(src.icon)
				I.SwapColor(rgb(0,0,255),rgb(src.Red,src.Green,src.Blue))
				src.icon = I

		forum()
			set hidden = 1
			src << link("http://forum.maztekia.com")

		freehand()
			set hidden = 1
			var/turf/t = src.loc
			var/obj/object/O = src.inv_equipped["free_hand"]
			for (var/obj/object/object in t.contents)
				if (O)
					src << "[O] in free hand"
				else
					object.Move(src)
					object.Force_equip(src, "free_hand")
					break

		get()
			set hidden = 1
			var/turf/t = src.loc
			var/obj/object/O = src.inv_equipped["pack"]
			if(O)
				if(!TurnController.Action(src)) return 0
				for (var/obj/object/object in t.contents)
					if(istype(object, /obj/object/Treasure))
						var/obj/object/Container/Purse/P = src.inv_equipped["purse"]
						object.Move(P)
					else
						object.Move(O)


		help()
			set hidden = 1
			src << "<U> \red Castle of the Winds Help</U>"
			//src << run('help.exe')

		hub()
			set hidden = 1
			src << link("http://games.byond.com/hub/Maz/CastleoftheWinds")

		inventory()
			set hidden = 1
			if(client.eye == locate("inv_center"))
				src.client.lazy_eye = 4
				client.eye = src
				client.perspective = MOB_PERSPECTIVE
				for(var/O in usr.inv_equipped)
					usr.client.screen -= usr.inv_equipped[O]
				for(var/obj/placeholder/p in client.screen)
					client.screen -= p


			else

				src.client.lazy_eye = 0
				client.eye = locate("inv_center")
				client.perspective = EYE_PERSPECTIVE
				for(var/turf/inv_slot/S in range(world.view,locate("inv_center")))
					S.inv_update(src)


		ip()
			set hidden = 1
			src << "IP address == byond://[world.address]:[world.port]"

		me(T as text)
			set desc = "(message) Emote."
			set hidden = 1
			if(!T)return
			if(T == "*")return
			if(Muted)return
			var/star = copytext("[T]",1,2)
			if (star == "*")
				var/newmsg = copytext(T,2)
				view() << ("<font color=[rgb(src.Red+30,src.Green+20,src.Blue+20)]>[src] [http_encode(newmsg)]")
			else
				world << ("<font color=[rgb(src.Red-20,src.Green-20,src.Blue-20)]>[src] [http_encode(T)]")

		npc(T as text)
			set hidden = 1
			var/mob/npc/R
			src << "You say <font color = blue>'[T]'</font> to the NPC's"
			for (R in oview(src))
				if(R!=src)
					R.ReactToSpeech(T,src)

/*		resthealth()
			set hidden = 1
			Locked = 1
			while (hp != maxhp)
				sleep(3)
				hp++
			Locked = 0

		restmana()
			set hidden = 1
			Locked = 1
			while (hp != maxhp)
				sleep(6)
				hp++
			Locked = 0*/

		Rest()
			if(!TurnController.Action(src)) return 0
			src.procRest()

		RPS(mob/M)
			set hidden = 1
			var/tmp/srcselection
			var/tmp/mselection
			var/tmp/turntaken
			var/tmp/turntaken2
			if(!M.client) // are they bots?
				switch(alert(src,"What Do You Choose?",,"Rock","Paper","Scissors"))
					if("Rock")
						turntaken = 1
						srcselection = "Rock"
					if("Paper")
						turntaken = 1
						srcselection = "Paper"
					if("Scissors")
						turntaken = 1
						srcselection = "Scissors"
				var/npcguess = rand(1,3)
				switch (npcguess)
					if (1) npcguess = "Rock"
					if (2) npcguess = "Scissors"
					if (3) npcguess = "Paper"

				sleep(20)
				src<<"<font color = #D563D2>Rock"
				sleep(5)
				src<<"<font color = #D452D2>Paper"
				sleep(5)
				src<<"<font color = #D341D2>Scissors"
				sleep(10)
				src<<"<BR>"
				if(srcselection == "Rock")
					if(npcguess == "Paper")
						src<<"<font color = #D563D2>Paper Covers Your Rock"
						src.RPS_loses++
						M<<"<font color = #D563D2>You Cover His Rock"
				if(srcselection == "Rock")
					if(npcguess == "Rock")
						src<<"<font color = #D563D2>You Tied"
						M<<"<font color = #D563D2>You Tied"
				if(srcselection == "Rock")
					if(npcguess == "Scissors")
						src<<"<font color = #D563D2>You Smash His Scissors"
						src.RPS_wins++
						M<<"<font color = #D563D2>He Smashes Your Scissors"
				if(srcselection == "Paper")
					if(npcguess == "Paper")
						src<<"<font color = #D563D2>You Tie"
						M<<"<font color = #D563D2>You Tie"
				if(srcselection == "Paper")
					if(npcguess == "Rock")
						src<<"<font color = #D563D2>You Cover His Rock"
						src.RPS_wins++
						M<<"<font color = #D563D2>He Covers Your Rock"
				if(srcselection == "Paper")
					if(npcguess == "Scissors")
						src<<"<font color = #D563D2>You Got Cut"
						src.RPS_loses++
						M<<"<font color = #D563D2>You Cut His Paper"
				if(srcselection == "Scissors")
					if(npcguess == "Paper")
						src<<"<font color = #D563D2>You Cut His Paper"
						src.RPS_wins++
						M<<"<font color = #D563D2>You Got Cut"
				if(srcselection == "Scissors")
					if(npcguess == "Rock")
						src<<"<font color = #D563D2>He Smashed You"
						src.RPS_loses++
						M<<"<font color = #D563D2>You Smashed Him"
				if(srcselection == "Scissors")
					if(npcguess == "Scissors")
						src<<"<font color = #D563D2>You Tied"
						M<<"<font color = #D563D2>You Tied"
				src.RPS_games++
				return
			else // they must be players?
				switch(alert(M,"Do You Want To Battle [src] In A Rock-Paper-Scissors Match?",,"Yea","Nah"))
					if("Yea")
						src<<"[M] Accepted"
						switch(alert(src,"What Do You Choose?",,"Rock","Paper","Scissors"))
							if("Rock")
								turntaken = 1
								srcselection = "Rock"
							if("Paper")
								turntaken = 1
								srcselection = "Paper"
							if("Scissors")
								turntaken = 1
								srcselection = "Scissors"
						switch(alert(M,"What Do You Choose?",,"Rock","Paper","Scissors"))
							if("Rock")
								turntaken2 = 1
								mselection = "Rock"
							if("Paper")
								turntaken2 = 1
								mselection = "Paper"
							if("Scissors")
								turntaken2 = 1
								mselection = "Scissors"

						while(turntaken2 == 1 | turntaken == 1)

							sleep(20)
							src<<"<font color = #D563D2>Rock"
							M<<"<font color = #D563D2>Rock"
							sleep(5)
							src<<"<font color = #D452D2>Paper"
							M<<"<font color = #D452D2>Paper"
							sleep(5)
							src<<"<font color = #D341D2>Scissors"
							M<<"<font color = #D341D2>Scissors"
							sleep(10)
							src<<"<BR>"
							M<<"<BR>"
							sleep(25)
							view(2,src) << "<font color=[rgb(src.Red,src.Green,src.Blue)]>[src]</font> Choose '[srcselection]',<font color=[rgb(M.Red,M.Green,M.Blue)]>[M]</font> Choose '[mselection]'."
							sleep(10)
							if(srcselection == "Rock")
								if(mselection == "Paper")
									src<<"<font color = #D563D2>Paper Covers Your Rock"
									M<<"<font color = #D563D2>You Cover His Rock"
									M.RPS_wins++
									src.RPS_loses++
							if(srcselection == "Rock")
								if(mselection == "Rock")
									src<<"<font color = #D563D2>You Tied"
									M<<"<font color = #D563D2>You Tied"
							if(srcselection == "Rock")
								if(mselection == "Scissors")
									src<<"<font color = #D563D2>You Smash His Scissors"
									src.RPS_wins++
									M<<"<font color = #D563D2>He Smashes Your Scissors"
									M.RPS_loses++
							if(srcselection == "Paper")
								if(mselection == "Paper")
									src<<"<font color = #D563D2>You Tie"
									M<<"<font color = #D563D2>You Tie"
							if(srcselection == "Paper")
								if(mselection == "Rock")
									src<<"<font color = #D563D2>You Cover His Rock"
									src.RPS_wins++
									M<<"<font color = #D563D2>He Covers Your Rock"
									M.RPS_loses++
							if(srcselection == "Paper")
								if(mselection == "Scissors")
									src<<"<font color = #D563D2>You Got Cut"
									src.RPS_loses++
									M<<"<font color = #D563D2>You Cut His Paper"
									M.RPS_wins++
							if(srcselection == "Scissors")
								if(mselection == "Paper")
									src<<"<font color = #D563D2>You Cut His Paper"
									src.RPS_wins++
									M<<"<font color = #D563D2>You Got Cut"
									src.RPS_loses++
							if(srcselection == "Scissors")
								if(mselection == "Rock")
									src<<"<font color = #D563D2>He Smashed You"
									src.RPS_loses++
									M<<"<font color = #D563D2>You Smashed Him"
									M.RPS_wins++
							if(srcselection == "Scissors")
								if(mselection == "Scissors")
									src<<"<font color = #D563D2>You Tied"
									M<<"<font color = #D563D2>You Tied"
							src.RPS_games++
							M.RPS_games++
							turntaken = 0
							turntaken2 = 0
							srcselection = ""
							mselection = ""
					else
						src<<"[M] Declined"

		say(t as text)
			set desc = "(message) Talk to the world or to local people (*)."
			set hidden = 1
			if(!t)return
			if(Muted)return
			var/mob/npc/R
			var/star = copytext("[t]",1,2)
			if (star == "*")
				var/star2 = copytext(t,length(t))
				if (star2 == "*")
					//world << {"<STYLE>IMG.icon{width:24px;height:24px}</STYLE><IMG CLASS =icon SRC=\ref[src]><font color=[rgb(src.Red,src.Green,src.Blue)]>[src]</font>: [emphasise(http_encode(t))]"}
					world << {"<STYLE>IMG.icon{width:24px;height:24px}</STYLE><IMG CLASS =icon SRC=\ref[src]><font color=[rgb(src.Red,src.Green,src.Blue)]>[src]</font>: [http_encode(t)]"}
				else
					var/newmsg = copytext(t,2)
					//view() << {"<STYLE>IMG.icon{width:24px;height:24px}</STYLE><IMG CLASS =icon SRC=\ref[src]><font color=[rgb(src.Red,src.Green,src.Blue)]>[src]</font>: <font color = "blue">[emphasise(http_encode(newmsg))]</font>"}
					view() << {"<STYLE>IMG.icon{width:24px;height:24px}</STYLE><IMG CLASS =icon SRC=\ref[src]><font color=[rgb(src.Red,src.Green,src.Blue)]>[src]</font>: <font color = "blue">[http_encode(newmsg)]</font>"}
			else
				//world << {"<STYLE>IMG.icon{width:24px;height:24px}</STYLE><IMG CLASS =icon SRC=\ref[src]><font color=[rgb(src.Red,src.Green,src.Blue)]>[src]</font>: [emphasise(http_encode(t))]"}
				world << {"<STYLE>IMG.icon{width:24px;height:24px}</STYLE><IMG CLASS =icon SRC=\ref[src]><font color=[rgb(src.Red,src.Green,src.Blue)]>[src]</font>: [http_encode(t)]"}
			for (R in oview(src))
				if(R!=src)
					R.ReactToSpeech(t,src)

		showcommands()
			set hidden = 1
			src.verbs += typesof(/mob/pc/FAKEMOB/verb)

		spell(spell as text)
			set hidden = 1
			if(!TurnController.CheckAction(src)) return 0
			cast(hudspells[spell])

		spoon()
			set hidden = 1
			src << {"<DIV align="center"><font color = "blue"><I><B>There is no spoon.</B></I></font></DIV>"}

		who()
			set hidden = 1
			set desc = "Seen who is online."
			var/layout
			layout += {"<DIV align="center"><font color = "blue"><I><B>Users Online</B></I></font>"}
			for (var/mob/pc/M in world)
				//var/picture as icon
				//picture = M.icon
				//for(var/atom/movable/K in overlays)
					//picture += K// do me
					//picture.Blend(K,ICON_OVERLAY)
				layout += {"<BR>\icon[M.icon] - <font color=[rgb(M.Red,M.Green,M.Blue)]>[M]</font>"}
			layout += "</DIV>"
			src << layout


















		NewLoadChar()  //Verb called when the player presses F2
			set hidden = 1
			var/mob/pc/P = src
			if(src.canNewLoad)
				src.canNewLoad = 0
				if(src.dead)
					if(P.PlayerIsSaved(src))
						switch(alert("Create a new Character or load from your last save?","Create New/Load Character","Create New Character","Load Character","Cancel"))
							if("Cancel")
								src.canNewLoad = 1
								return 0
							if("Create New Character")
								switch(alert("You already have an existing character named [src], do you want to delete it?","New Character","Yes","No"))
									if("Yes")
										P.DeletePlayer(src)
									if("No")
										src.canNewLoad = 1
										return 0
								src.Teleport(locate(7,5,1))
								src.hp = 200
								src.maxhp = 400
					//			Login_Form()
							else
								players_list -= src
								P.LoadPlayer(src)
								src.canNewLoad = 1
					else
						switch(alert("Create a New Character?","New Character","Yes","No"))
							if("No")
								src.canNewLoad = 1
								return 0
						src.Teleport(locate(7,5,1))
						src.hp = 200
						src.maxhp = 400
				//		Login_Form()
				else
					switch(alert("Create a New Character?","New Character","Yes","No"))
						if("No")
							src.canNewLoad = 1
							return 0
					if(P.PlayerIsSaved(src))
						switch(alert("You already have an existing character named [src], do you want to delete it?","New Character","Yes","No"))
							if("Yes")
								P.DeletePlayer(src)
							if("No")
								src.canNewLoad = 1
								return 0
					src.Teleport(locate(7,5,1))
					src.hp = 200
					src.maxhp = 400
				//	Login_Form()



/*		Inventory()
			set hidden = 1
			if (!ininventory)
				oldX = x
				oldY = y
				oldZ = z
				Locked = 1
				ininventory = 1
				invisibility = 101
				oldloc = src.loc
				loc = locate(98,16,1)
				for(var/X in typesof(/obj/playerobjects/HUD))
					if(locate(X) in src.contents)
						client.screen += new X
			else
				x = oldX
				y = oldY
				z = oldZ
				Locked = 0
				ininventory = 0
				invisibility = 0
				closeall() // close all huds
*/
//for disabling click macro's
		DisClick(argu = null as anything, second = "" as text, number1 = 0 as num  , number2 = 0 as num)
			set name = ".click"
			set category = null
			return

		DisDblClick(argu = null as anything, second = "" as text, number1 = 0 as num  , number2 = 0 as num)
			set name = ".dblclick"
			set category = null
			return

mob/pc/FAKEMOB
	verb
		_Activate()
			src.Activate()
		_Bwicki()
			src.bwicki()
		_Cast(spell as text)
			src.cast(spell)
		_Climb()
			src.climb()
		_Commands()
			src.commands()
		_Drink()
			src.drink()
		_Forum()
			src.forum()
		_Get()
			src.get()
		_Help()
			src.help()
		_Hub()
			src.hub()
		_Ip()
			src.ip()
		_Me((T as text))
			src.me(T)
		_NPC((T as text))
			src.npc(T)
	/*	_Resthealth()
			src.resthealth()
		_Reshmana()
			src.restmana()*/
		_RPS(mob/M in get_step(src,src.dir))
			src.RPS(M)
		_Say((T as text))
			src.say(T)
		_Spell(spell as text)
			src.spell(spell)
		_Who()
			src.who()


		hide_commands()
			killverbs()
	proc
		killverbs()
			src.verbs -= typesof(/mob/pc/FAKEMOB/verb)